<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/AjaxUtil.js"></script>
</head>
<body>
datasource
TODO: 动态添加的数据源，事务问题
<div>
    <!--
driverClassName: org.sqlite.JDBC
url: jdbc:sqlite::resource:static/sqllite/ucms.db
username:
password:

driverClassName: org.postgresql.Driver
url: jdbc:postgresql://10.161.64.87:5432/dss4
username: postgres
password: 123456
     -->
    <form>
        code(唯一不可重复):<input type="text" id="code" name="code" value="sqlc"></br>
        dbType:    <input type="text" id="dbType" name="dbType" value="sqlite"></br>

        dbIp:        <input type="text"  id="dbIp" name="dbIp" value="localhost"></br>
        dbPort:      <input type="text" id="dbPort" name="dbPort" value="5432"></br>
        dbName:      <input type="text" id="dbName" name="dbName" value="sqlc.db"></br>
        dbUsername:  <input type="text" id="dbUsername" name="dbUsername" value=""></br>
        dbPassword:  <input type="text" id="dbPassword" name="dbPassword" value=""></br>
        dbCurrent:   <input type="text" id="dbCurrent" name="dbCurrent" value="1">

        <input type="button" value="submit" onclick="save()">
    </form>
</div>

</body>
<script type="text/javascript">
function init() {
    
}
function save() {
    var sendData = {
        code: document.getElementById("code").value,
        dbType: document.getElementById("dbType").value,
        dbName: document.getElementById("dbName").value,
        dbCurrent: document.getElementById("dbCurrent").value
    }
    var url = 'http://localhost:8080/dataSourceSetting/add'
    fetchUtil.doPost(url,sendData)
        .then(data => {console.log(data)});
}
</script>
</html>
